//*************************************************************************************
// Indexing functions used for mapping given bitboard position to the arrays index
// in the sub-database slice
//*************************************************************************************

#pragma once

#include "Common.h"


 // template switching of indexing functions between different bitboard sizes
//////////////////////////////////////////////////////////////////////////////////

// BitBoard => Index
template<typename BB> void BitBoardToIndexXX(BB* p, int64* index);

template<> void BitBoardToIndexXX<BitBoard>(BitBoard* p, int64* index);
template<> void BitBoardToIndexXX<BitBoard64>(BitBoard64* p, int64* index);

// Index => BitBoard
template<typename BB> void IndexToBitBoardXX(int64 index, BB *p, 
											int wm, int wk, int bm, int bk, int wmrank,  int bmrank);
template<> void IndexToBitBoardXX<BitBoard>(int64 index, BitBoard *p, 
											int wm, int wk, int bm, int bk, int wmrank,  int bmrank);
template<> void IndexToBitBoardXX<BitBoard64>(int64 index, BitBoard64 *p, 
											int wm, int wk, int bm, int bk, int wmrank,  int bmrank);

